package com.heima.common.exception;

import com.heima.common.dtos.AppHttpCodeEnum;
import lombok.Getter;

/*
    自定义业务异常
 */
@Getter
public class LeaNewsException extends RuntimeException{
    private Integer status; //状态码
    //private String message; //异常信息(父类有直接用)

    public LeaNewsException(Integer status,String message){
        super(message);
        this.status = status;
    }


    public LeaNewsException(AppHttpCodeEnum appHttpCodeEnum) {
        super(appHttpCodeEnum.getErrorMessage());
        this.status = appHttpCodeEnum.getCode();
    }
}
